package com.ufo.mybatistest2.Service;

import com.ufo.mybatistest2.Mapper.userMapper;
import com.ufo.mybatistest2.entity.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Author ufo
 * @Description TODO
 * @Date 2021/1/15 11:22
 * @Version 1.0
 */


@Slf4j
@Service
@Transactional
public class userServiceImpl implements userService{

    @Autowired
    userMapper userMapper;


    @Override
    @Cacheable("users")
    public User Selabc(int id) {
        log.info("=====二级缓存直接不会进来的=====");
        User selabc = userMapper.Selabc(id);
        return selabc;
    }
}
